$(document).ready(function() {
	//用户登录
	$("#btnLogin").click(function(){
	   var inputdata ={
	   		param_name: "N01_CG3880",
	   		login_id:$("#login_id").val(),
			param_value1: $("#login_id").val(),
			param_value2: $("#login_pwd").val()
	   }
	   get_ajax_staticurl(inputdata, "get_N01_CG3880");
   	})
   	
   	var inputdata = {
        "param_name": "T01_VX0Y6B"
    };
   	ly_index = layer.load();
   	get_ajax_baseurl(inputdata, "get_T01_VX0Y6B");	
});

//用户登录2 新版本权限登录方式
function get_N01_CG3880(input){
	if (Call_QryResult(input.N01_CG3880) == false){		
	}
	else
	{
		localStorage.setItem('session_id', input.N01_CG3880[0][GetLowUpp("session_id")]);				
		localStorage.setItem('login_id', input.N01_CG3880[0][GetLowUpp("login_id")]);			
		localStorage.setItem('nick_name', s_decode(input.N01_CG3880[0][GetLowUpp("nick_name")]));
		localStorage.setItem('user_main_id', s_decode(input.N01_CG3880[0][GetLowUpp("user_main_id")]));
		localStorage.setItem('role_id', s_decode(input.N01_CG3880[0][GetLowUpp("role_id")]));
		//可自行扩展用户信息
		window.location.href = "index.html";
	}
}

//用户登录，老版本权限登录方式
function get_A01_CG3NLW(input){
	//查询失败
	if (Call_QryResult(input.A01_CG3NLW) == false){		
	}
	else
	{
		localStorage.setItem('session_id', input.A01_CG3NLW[0][GetLowUpp("session_id")]);				
		localStorage.setItem('login_id', input.A01_CG3NLW[0][GetLowUpp("login_id")]);			
		localStorage.setItem('nick_name', s_decode(input.A01_CG3NLW[0][GetLowUpp("nick_name")]));
		localStorage.setItem('user_main_id', s_decode(input.A01_CG3NLW[0][GetLowUpp("user_main_id")]));
		localStorage.setItem('role_id', s_decode(input.A01_CG3NLW[0][GetLowUpp("role_id")]));
		window.location.href = "index.html";
	}
}

function get_T01_VX0Y6B(input) {
	var vResult = "";
    layer.close(ly_index);
    var inputs = input.T01_VX0Y6B;
    //查询失败
    if (Call_QryResult(inputs) == false)
        return false;
    $.each(inputs, function (i, obj){
    	if(obj.PARAM_KEY == "station_name"){
    		vResult += s_decode(obj.PARAM_VALUE);
    	}
    	else if(obj.PARAM_KEY == "title"){
    		vResult += s_decode(obj.PARAM_VALUE);
    	}
    });
    s_title = vResult;
    localStorage.setItem('s_title', vResult);
    $("title").html("欢迎使用"+s_title);
    $("#div_title").html(s_title);
}